import React, { useState,useEffect } from 'react'
import Header from '../../components/Header/Header'
import {reqbanner} from '../../request/api'
import { imgPre } from '../../request/http'
import {Swiper} from 'antd-mobile'

 function Mine() {
  const [banner,setBanner]=useState([])

  useEffect(()=>{
    reqbanner().then(res=>{
      if(res.data.code==200){
        setBanner(res.data.list)
      }
    })
  },[])
    return (
      <div>
        <Header title={'我的'} back></Header>
        {/* <Swiper autoplay>{items}</Swiper> */}
        {/* <div>{JSON.stringify(banner)}</div> */}
        <Swiper autoplay style={{"--height":"4rem"}}>
          {/* <Swiper.Item></Swiper.Item> */}
         {banner.map((item)=>{
          return(
           
               <Swiper.Item key={item.id}>
               <img src={imgPre+item.img} alt="" />
              </Swiper.Item>
          
          )
        })}
      </Swiper>
      </div>
    )
  }


export default Mine